import 'dart:async';

import 'package:flutter/services.dart';

import 'suota_platform_interface.dart';

class Suota {
  final EventChannel _eventChannel = const EventChannel('updateEventChannel');

  Future<String?> getPlatformVersion() {
    return SuotaPlatform.instance.getPlatformVersion();
  }

  //iOS 使用
  Future<void> disconnect() {
    return SuotaPlatform.instance.disconnect();
  }

  Stream<dynamic> startUpdate(String filePath, String name) {
    SuotaPlatform.instance.startUpdate(filePath, name);
    return _eventChannel.receiveBroadcastStream();
  }
}
